# coding=utf-8

from selenium.webdriver.common.by import By
from PageObject.add_member_page import AddMemberPage
from PageObject.base_page import BasePage


class MainPage(BasePage):
    """
    企业微信首页PO类
    """
    # 首页URL
    _base_url = "https://work.weixin.qq.com/wework_admin/frame#index"

    # 元素定位
    _add_member_selector = (By.CSS_SELECTOR, ".ww_indexImg_AddMember")

    def go_to_add_member(self):
        """ 跳转到添加成员页面
        :return: 返回一个AddMemberPage实例
        """
        self.find(self._add_member_selector).click()
        return AddMemberPage(self.driver)
